package com.example.home.model

import android.content.Context
import android.util.AttributeSet
import android.view.MotionEvent
import androidx.recyclerview.widget.RecyclerView
/*
    自定义View
 */
class NonScrollRecyclerView @JvmOverloads  constructor(
    context: Context,
    attrs:AttributeSet?=null,
    defStyleAttr:Int=0
):RecyclerView(context,attrs,defStyleAttr){
    //禁止触摸滚动
    override fun onTouchEvent(e: MotionEvent?): Boolean =false
    //禁止惯性滚动
    override fun fling(velocityX: Int, velocityY: Int): Boolean =false
    //禁止垂直滚动
    override fun canScrollVertically(direction: Int): Boolean =false
}